package com.example.project;

import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Conditional;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.web.context.support.GenericWebApplicationContext;

@EnableRetry(proxyTargetClass = true)
@ConditionalOnBean
public class NoteClasses {
//    容器
	// AbstractApplicationContext 》》 AbstractRefreshableApplicationContext
	// AbstractBeanFactory 》》 AbstractAutowireCapableBeanFactory.doCreateBean
    // AbstractApplicationContext.refresh --> GenericWebApplicationContext
	// AbstractAutowireCapableBeanFactory
	// DefaultListableBeanFactory
    // HierarchicalBeanFactory
	// DefaultSingletonBeanRegistry
//	AnnotationConfigRegistry
	// 子类实现 5.1.9：
	// AnnotationConfigWebApplicationContext.loadBeanDefinitions

//    BeanDefinition解析加载
	// ClassPathBeanDefinitionScanner
	// ComponentScanAnnotationParser
	// AnnotatedBeanDefinitionReader
	// ConfigurationClassParser
	// ConfigurationClassBeanDefinitionReader
	// ImportBeanDefinitionRegistrar

//    增强器
	// BeanDefinitionRegistryPostProcessor
	// MergedBeanDefinitionPostProcessor
	// AbstractAdvisingBeanPostProcessor
	// ConfigurationClassPostProcessor
    // 第三级缓存增强器    
    //    AutowiredAnnotationBeanPostProcessor
    // AnnotationAwareAspectJAutoProxyCreator    

//    Bean元数据
	// ConfigurationClassParser.SourceClass
	// RootBeanDefinition

	// ConfigurationClass
	// MergedBeanDefinition
	// AnnotatedBeanDefinition
	// ConfigurationClassBeanDefinitionReader.ConfigurationClassBeanDefinition
	// AnnotatedGenericBeanDefinition
	// ScannedGenericBeanDefinition

//    Bean实例   
	// FactoryBean
	// SmartFactoryBean
	// NamedBean
	// NamedBeanHolder
	// ObjectFactory
	// org.springframework.aop.framework.ProxyFactoryBean

//	AOP
	// 增强器加载
	// @EnableXXX --> @Import
	// ..............|--AdviceModeImportSelector -> ConfigurationClassParser.processImports
    // .................|-- mode proxy Async
	// ....................|-- AsyncConfigurationSelector
	// .......................|--ProxyAsyncConfiguration -> AbstractAsyncConfiguration
	// ..........................|-- AsyncAnnotationBeanPostProcessor
	// .............................|-- AsyncAnnotationAdvisor
	// ................................|--AnnotationAsyncExecutionInterceptor(advice) -> MethodInterceptor
	// ................................|--AnnotationMatchingPointcut
	// ...................................|--AnnotationClassFilter
	// ...................................|--AnnotationCandidateClassFilter
	// ...................................|--AnnotationMethodMatcher
	// ....................|-- AbstractTransactionManagementConfiguration
	// ....................|-- AutoProxyRegistrar
	// .................|-- mode aspectJ Async
	// ....................|-- AspectJJtaTransactionManagementConfiguration
	// ....................|-- AspectJTransactionManagementConfiguration
	// ....................|-- AspectJAsyncConfiguration -> AbstractAsyncConfiguration
	// .......................|-- AnnotationAsyncExecutionAspect

	// Bean增强
	// ....|-- mode proxy
	// ..........|-- AsyncAnnotationBeanPostProcessor.postProcessAfterInitialization()
	// .............|--Advised -> AdvisedSupport
	// .............|--ProxyFactory
	// ....|-- mode aspectj
	// .......|-- Type @AspectJ 对象 RegisterBPP -> new ReflectiveAspectJAdvisorFactory -> new BeanFactoryAspectJAdvisorsBuilderAdapter
	// ..........|-- AnnotationAwareAspectJAutoProxyCreator.postProcessBeforeInstantiation
	// .............|-- findCandidateAdvisors() -> buildAspectJAdvisors()
	// ..........|-- AnnotationAwareAspectJAutoProxyCreator.postProcessAfterInstantiation
	// .............|--ProxyFactory
	// .......|-- Type AspectJAsyncConfiguration
	// ..........|-- AnnotationAsyncExecutionAspect 按普通单例Bean实例化，用了特殊编译器 finishBeanFactoryInitialization	
	
	//	BeanFactoryTransactionAttributeSourceAdvisor
	//	InstantiationModelAwarePointcutAdvisor
	
	// org.springframework.transaction.aspectj.AnnotationTransactionAspect
	// CglibAopProxy
	// ProxyProcessorSupport >> AbstractAdvisingBeanPostProcessor
	// 》》 MethodValidationPostProcessor
	// AbstractPointcutAdvisor
	// DefaultAdvisorChainFactory

//	Async
	// ProxyAsyncConfiguration
	// AbstractAdvisingBeanPostProcessor 》》 AsyncAnnotationBeanPostProcessor

	// AnnotationAsyncExecutionInterceptor
	// AsyncAnnotationAdvisor

//	TX
	// @EnableTransactionManagement
	// |-TransactionManagementConfigurationSelector
	// TransactionInterceptor
//	

//        boot：
	// DefaultBootstrapContext
	// BeanDefinitionLoader
    
//    ApolloApplicationContextInitializer 
//    com.ctrip.framework.apollo.internals.LocalFileConfigRepository

	public static void main(String[] args) {
		GenericWebApplicationContext c = new GenericWebApplicationContext();
		c.refresh();
		c.registerBean(null, null);
		
	}
}
